package com.xcm.controller;

import com.xcm.model.vo.OperationLogListVO;
import com.xcm.page.PageInfo;
import com.xcm.service.OperationLogService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping(value = "/operationLog")
public class OperationLogController {
	private static Logger logger = LoggerFactory.getLogger(OperationLogController.class);

	@Autowired
	private OperationLogService operationLogService;

	/**
	 * 操作日志列表
	 */
	@RequestMapping(value = "/list")
	public String listOperationLog(String startTime, String endTime, Integer pageNum, Integer pageSize, Model model) {
		PageInfo<OperationLogListVO> operationLogPageInfo = operationLogService.listOperationLogByPage(startTime, endTime, pageNum, pageSize);
		model.addAttribute("startTime", startTime);
		model.addAttribute("endTime", endTime);
		model.addAttribute("operationLogList", operationLogPageInfo.getList());
		model.addAttribute("pageNum", operationLogPageInfo.getPageNum());
		model.addAttribute("pageSize", operationLogPageInfo.getPageSize());
		model.addAttribute("total", operationLogPageInfo.getTotal());
		return "operationLog_list";
	}
}
